<template>
	<view class="cardstyle" style="background-color: white;">
		<view style="display:flex;flex-direction: row;">
		<image src="/static/logo.png" style="height: 60px;width: 60px;"></image>
		<text class="titlebox" style="padding-left: 10px;">{{title}}</text>
		</view>
		<view class="tipsbox">
			<text style="color: red" v-if="isTop">置顶</text>
			<text class="tips">{{author}}</text>
			<text class="tips">{{comments}}评</text>
			<view class="tipsend" style="padding-left: 20rpx">
				<text class="tips">{{time}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "cardViewText",
		data() {
			return {
				title: "党的二十大",
				isTop: true,
				author: "人民日报",
				comments: 666,
				time: "2025.11.08"
			};
		},
		props:{
			title:{
				type: String,
				default:"新闻标题",
				require:true
			},
			isTop:{
				type: Boolean,
				default:false,
				require:true
			},
			author:{
				type: String,
				default:"来源",
				require:true
			},
			comments:{
				type: String,
				default:"0",
				require:true
			},
			time:{
				type: String,
				default:"2025.11.11",
			},
		}
	}
</script>

<style>
	.cardstyle {
		margin: 10px;
		padding: 10px;
		border-radius: 10px;
		box-shadow: 0 2px 4px rgba(1, 0.5,0.4,0.4);
	}

	.titlebox {
		font-weight: bold;
		font-size: 20px;
	}

	.tipsbox {
		font-size: 15px;
		margin-top: 10px;
		display: flex;
	}

	.tips {
		margin-left: 10px;
		color: #aaa;
	}

	.tipsend {
		flex: 1;
		display: flex;
		justify-content: flex-end;
	}
</style>